<h2> Comments </h2>
   <hr>
{% if page.commentable == true %}
	{% if page.comments %}
		{% assign sorted_comments = (page.comments | sort: 'date') %}
	{% endif %}
	{% for c in sorted_comments %}
		<div class="media">
			<div class="media-left">
				<img src="{{ c.author.picture }}" alt="{{ c.author.displayName}}" height="73" width="73">
			</div>
			<div class="media-body">
				<p class="text-muted">
				 <a href="{{ c.author.url }}">{{ c.author.displayName }}</a> {% if c.author.displayName == site.github_username %}<code>owner</code> {% endif %} at {{ c.date | date: "%e %b, %Y %k:%M" }}
				</p>
				<p>{{ c.content | newline_to_br | markdownify }}</p>
			</div>
		</div>
	{% else %}
		{% if page.protected == true %}
			<h6 style="color:#34495e;margin-bottom: auto;" >&#128517; Comments on this page are now protected.</h6>
		{% else %}
			<h6 style="color:#34495e;margin-bottom: auto;"> Be the first one to comment on this page!</h6>
		{% endif %}
	{% endfor %}
{% else %}
		<h6 style="color:#34495e;margin-bottom: auto;">&#128517; Commenting is disabled on this post.</h6>
{% endif %}

{% if page.protected == false %}
    <noscript>Please enable JavaScript to view the comment form powered by <a href="https://commentit.io/">Comm(ent|it)</a></noscript>
		<div style="font-size: smaller;">You can use <a href="{{site.url}}{{site.baseurl}}/info/markdown-syntax">extended GitHub flavored markdown</a> in your comment. <a href="{{site.url}}{{site.baseurl}}/info/commenting-guidelines">Commenting FAQs & Guidelines </a></div> 
    <div id="commentit"></div>
		

	<script type="text/javascript" async>
	  /** CONFIGURATION VARIABLES **/
	  var commentitUsername = '{{site.github_username}}';
	  var commentitRepo = '{{site.github_username}}/{{site.github_username}}.github.io';
	  var commentitPath = '{{ page.path }}';

	  /** DON'T EDIT FOLLOWING LINES **/
	  (function() {
		  var commentit = document.createElement('script');
		  commentit.type = 'text/javascript';
		  commentit.async = true;
		  commentit.src = 'https://commentit.io/static/embed/dist/commentit.js';
		  (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(commentit);
	  })();
	</script>
{% endif %}

